<template>
  <div class="app">
    <swiper-item>
      <u-grid :col="3">
        <u-grid-item v-for="(item, index) in Gongge" :index="index" :key="index" @click="GonggeClick(item, index)">
          <u-icon :name="item.icon" :size="46"></u-icon>
          <u-badge v-show="inc" count="9" :offset="[20, 20]"></u-badge>
          <text class="grid-text">{{ item.msg }}</text>
        </u-grid-item>
      </u-grid>
    </swiper-item>
  </div>
</template>

<script>
export default {
  name: 'gongge',
  props: {
    Gongge: {}, //传入的宫格数据
    inc: {
      type: Boolean,
      default() {
        return false;
      },
    },
    GoPages: {
      type: Boolean,
      default() {
        return false;
      },
    },
  },
  data() {
    return {};
  },
  mounted() {
    // console.error(this.GoPages);
  },
  methods: {
    GonggeClick(e) {
      if (this.GoPages && e.url) {
        console.log(e.url);
        uni.navigateTo({
          url: e.url,
        });
      }
    },
  },
};
</script>

<style></style>
